package com.youuvs.exception;


import com.youuvs.enums.GlobalEnumCode;
import lombok.Data;

@Data
public class GlobalCustomException extends RuntimeException{
    //异常信息
    private String errorMessage;
    //异常码
    private String errorCode;

    //自定义异常无参构造
    public GlobalCustomException(){
        super();
    }
    public GlobalCustomException(String message){
        super(message);
    }

    //自定义有参构造
    public GlobalCustomException(String errorMessage,String errorCode){
        super(errorMessage);
        this.errorMessage = errorMessage;
        this.errorCode = errorCode;

    }

    public GlobalCustomException(GlobalEnumCode globalEnumCode){
        super(globalEnumCode.getMessage());
        this.errorMessage = globalEnumCode.getMessage();
        this.errorCode = globalEnumCode.getCode();

    }

}

